package com.era.act.usr;

import com.era.entity.Users;
import com.era.srv.UsersSrv;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class UserRegisterAction extends ActionSupport implements
		ModelDriven<Users> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4897078686293182290L;
	private Users usr = new Users();
	private UsersSrv usersSrv;
	public String regist() throws Exception {
		System.out.println("ע���û���Ϊ"+usr.getUsersName());
		if (usr.getUsersName() != null && usr.getUsersPasswd() != null) {
			if (usersSrv.registerUser(usr)) {
				return SUCCESS;
			}
		}
		return ERROR;
	}
	
	public String showPage() throws Exception{
		return INPUT;
		
	}
	@Override
	public Users getModel() {
		// TODO Auto-generated method stub
		return usr;
	}

	public UsersSrv getUsersSrv() {
		return usersSrv;
	}

	public void setUsersSrv(UsersSrv usersSrv) {
		this.usersSrv = usersSrv;
	}
	
	
}
